<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
 <%@taglib prefix="s" uri="/struts-tags"%>
 <%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Insert title here</title>
</head>
<body>
		<div id="news_list">
					<s:if test="#request.topicList != null && #request.topicList.size()>0">
						<s:iterator id="var_topic" value="#request.topicList">
								
									 <div class="admin_newsList_div">
										<div class="admin_newsList_title">${var_topic.name }</div>
										<div class="admin_newsList_author">
											<input type="button" value="修改" onclick="update_topic(${var_topic.id})" />&nbsp;
											<input type="button" value="删除" onclick="delete_topic(${var_topic.id})"/>
										</div> 
									</div>
								
							</s:iterator>
						
					<div id="show_page">
					<ul>
						<s:if test="pager.curPage > 1">
							<li> <a href="doEditTopic?pager.curPage=1&topic.id=${requestScope.topic.id }">首页</a> </li>
							<li><a href="doEditTopic?pager.curPage=${pager.curPage - 1}&topic.id=${requestScope.topic.id }">上一页</a></li>
						</s:if>
						
						<s:if test="pager.curPage < pager.pageCount">
				 			<li><a href="doEditTopic?pager.curPage=${pager.curPage + 1 }&topic.id=${requestScope.topic.id }">下一页</a></li>
				 			<li><a href="doEditTopic?pager.curPage=${pager.pageCount }&topic.id=${requestScope.topic.id }">尾页</a></li>
				 			
				 		</s:if>
				 		<li>总共${pager.curPage}/${pager.pageCount} 页</li>
				 		<li>
				 		  <form action="doEditTopic" method="post">
				 		  	跳转到<select name="pager.curPage" size="1">
				 		  		<s:bean name="org.apache.struts2.util.Counter" id="counter">
				 		  			<s:param name="first" value="1"/>
				 		  			<s:param name="last" value="%{pager.pageCount}"/>
				 		  			<s:iterator>
				 		  				<option value='<s:property/>'><s:property/></option>
				 		  			</s:iterator>
				 		  		</s:bean>
				 		  	</select>
				 		  	<input type="hidden" name="topic.id" value="${requestScope.topic.id}"/>
				 		  	<input type="submit" value="跳转"/>
				 		  </form>
				 		</li>
					</ul>
				</div>
						
					</s:if>
					<s:else>
					<div class="no_news">
						抱歉，暂无新闻主题!
					</div>
					</s:else>
					
				</div>
</body>
</html>